Headspace analysis for biological material